package com.kwlt.smc.entity;

import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.kwlt.smc.util.ConUtils;


/**
 * 黑名单
 * @author wangweiheng
 *
 */
@Entity
@Table(name="BLACKLIST")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Blacklist {
	/**
	 * 黑名单Id
	 */
	private Long blacklistId;
	/**
	 * 黑名单类型  b 黑名单 r 红名单 w 白名单
	 */
	private String type;
	/**
	 * 黑名单来源 1 运营商 2 通道 3 客户 4 其他
	 */
	private String source;
	/**
	 * 级别 1 全局 2 局部
	 */
	private String level;
	/**
	 * 黑名单号码
	 */
	private String phoneNumber;
	/**
	 * 用户编号
	 */
	private String userCode;
	/**
	 * 通道编号
	 */
	private String channelCode;
	
	/**
	 * 运营商
	 */
	private String operators;
	/**
	 * 状态
	 */
	private String status;
	private Date createDate;
	
	private String createBy;
	
	/**
	 * 格式化时间
	 */
	private String createDateStr;
	
	public Blacklist(){
		
	}
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getBlacklistId() {
		return blacklistId;
	}

	public void setBlacklistId(Long blacklistId) {
		this.blacklistId = blacklistId;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getOperators() {
		return operators;
	}
	public void setOperators(String operators) {
		this.operators = operators;
	}
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
		this.setCreateDateStr(ConUtils.formatDate(createDate,"yyyy-MM-dd"));
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}
	
	public String getUserCode() {
		return userCode;
	}
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	public String getChannelCode() {
		return channelCode;
	}
	public void setChannelCode(String channelCode) {
		this.channelCode = channelCode;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	@Transient	
	public String getCreateDateStr() {
		return createDateStr;
	}

	public void setCreateDateStr(String createDateStr) {
		this.createDateStr = createDateStr;
	}
	@Override
	public String toString() {
		return "Blacklist [blacklistId=" + blacklistId + ", type=" + type
				+ ", source=" + source + ", level=" + level + ", phoneNumber="
				+ phoneNumber + ", userCode=" + userCode + ", channelCode="
				+ channelCode + ", operators=" + operators + ", status="
				+ status + ", createDate=" + createDate + ", createBy="
				+ createBy + ", createDateStr=" + createDateStr + "]";
	}
	
	
}
